package com.company.common.auth.service.impl;

import java.util.Map;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.company.cloud.common.bean.LoginUserInfo;
import com.company.cloud.common.redis.service.RedisUtils;
import com.company.common.auth.service.SecurityUrlService;
import com.company.common.auth.util.SecurityUrlUtils;

@Service
public class SecurityUrlServiceImpl implements SecurityUrlService {

	@Autowired
	private RedisUtils redisUtils;

	@Override
	public void initCache(Map<String, Set<String>> urls) {
		SecurityUrlUtils.initCache(urls, redisUtils);
	}

	@Override
	public void removeCache() {
		SecurityUrlUtils.removeCache(redisUtils);
	}

	@Override
	public LoginUserInfo check(String url, String token) {
		return SecurityUrlUtils.check(url, token, redisUtils);
	}

}
